package jpa.entitys.promis.common;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the HUMANS database table.
 * 
 */
@Embeddable
public class HumanPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=2)
	private String company;

	@Column(name="HUMAN_CODE", unique=true, nullable=false, length=10)
	private String humanCode;

    public HumanPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getHumanCode() {
		return this.humanCode;
	}
	public void setHumanCode(String humanCode) {
		this.humanCode = humanCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof HumanPK)) {
			return false;
		}
		HumanPK castOther = (HumanPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.humanCode.equals(castOther.humanCode);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.humanCode.hashCode();
		
		return hash;
    }
}